<?php
class Picture extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->setTableName('picture');

        $this->hasColumn('article_id', 'integer');
        $this->hasColumn('title', 'string', 255, array('notblank' => true));
        $this->hasColumn('description', 'string', null, array('notblank' => true));
        $this->hasColumn('position', 'integer');
        $this->hasColumn('place', 'string', 255);
        $this->hasColumn('filename', 'string', null);
    }

    public function setUp()
    {
        $this->hasOne('Article as article', array(
                'local'=>'article_id',
                'foreign'=>'id'
        ));

        $this->actAs('Timestampable',
            array('updated' => array('onInsert' => false)));
    }
}
?>